package com.corner.model.cornerservice.domain;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.Expose;

public class GeoPoint implements Parcelable {
    public static final Parcelable.Creator<GeoPoint> CREATOR = new Parcelable.Creator<GeoPoint>() {
        public GeoPoint createFromParcel(Parcel source) {
            return new GeoPoint(source);
        }

        public GeoPoint[] newArray(int size) {
            return new GeoPoint[size];
        }
    };
    @Expose
    private Double longtitude;
    @Expose
    private Double latitude;

    public GeoPoint(Double latitude, Double longtitude) {
        this.latitude = latitude;
        this.longtitude = longtitude;
    }

    public GeoPoint() {
    }

    protected GeoPoint(Parcel in) {
        this.longtitude = (Double) in.readValue(Double.class.getClassLoader());
        this.latitude = (Double) in.readValue(Double.class.getClassLoader());
    }

    public Double getLongtitude() {
        return longtitude;
    }

    public void setLongtitude(Double longtitude) {
        this.longtitude = longtitude;
    }

    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.longtitude);
        dest.writeValue(this.latitude);
    }
}
